<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>

</body>
<script>
  class Person {
    constructor(name, age) {
      this.name = name;
      this.age = age;
    }

    species = "chongbo";
    skill() {
      console.log("冲波");
    }
    say() {
      console.log(this, name, this.age);
    }
  }
  var p = new Person("喜马拉雅", 1);
  console.log(p);

  class YellowPersone extends Person {
    constructor(name, age, hobby) {
      super(name, age);
      this.hobby = hobby;
    }

    speak() {
      console.log("喜马拉雅周冲波");
    }

    say() {
      console.log(this.name, this.age, this.hobby);
    }
  }



  var yp = new YellowPersone("周冲波", 20, "冲刺");
  console.log(yp);

  // yp.say();
  // yp.skill();
  // console.log(yp.species);
</script>

</html>